﻿using System;
using System.Net;
using Microsoft.Phone.Net.NetworkInformation;
using System.Windows;

namespace CloudTaobao.Util
{
    public class Utils
    {
        public static string filterSpanString(string origin)
        {
            string filtered = origin;
            if (filtered.Contains("span"))
            {
                filtered = filtered.Replace("<span class=H>", "[");
                filtered = filtered.Replace("</span>", "]");
            }
            return filtered;
        }

        public static bool isShowPic()
        {
            App app = Application.Current as App;
            if (NetworkInterfaceType.Wireless80211 != app.netType
                && !app.isShowPicNoWIFI)
                return false;
            else
                return true;
        }

        public static int getRecordsNum()
        {
            App app = Application.Current as App;
            if (NetworkInterfaceType.Wireless80211 != app.netType)
                return app.recordsNoWIFI;
            else
                return app.records;
        }
    }
}
